<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/include/page.jsp"%>
<c:set value="${requestScope.response.data.one }" var="one" />
<jsp:useBean class="com.wsh.shop.users.pojo.AAdmins" id="pojo"/>
<!DOCTYPE HTML>
<html>
	<head>
		<meta charset="utf-8">
		<title>更新管理员 - 管理员管理 - 商城</title>
		<meta name="keywords" content="添加管理员 - 管理员管理 - 商城">
		<meta name="description" content="添加管理员 - 管理员管理 - 商城">
		<%@ include file="/common/include/title_back.jsp" %>
	</head>
	<body>
		更新管理员
		<article class="page-container">
			${requestScope.info }
			<form class="form form-horizontal" id="formSubmit" 
				action="${rootPath}/back/AdminsBackServlet?method=adminsUpdateSubmit" method="post">
				<!-- 在更新提交的时候,加上id(隐藏域) -->
				<input type="hidden" name="id" value="${one.id }">
				<input type="hidden" name="operType" value="update">
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-3">
						<span class="c-red">*</span>邮箱：
					</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" class="input-text" placeholder="@" name="email" id="email"
							value="${one.email }">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-3">
						<span class="c-red">*</span>真实姓名：
					</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" class="input-text" value="${one.name }" placeholder="" id="name" name="name">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-3">
						<span class="c-red">*</span>性别：</label>
					<div class="formControls col-xs-8 col-sm-9 skin-minimal">
						<div class="radio-box">
							<label for="sex0">
								<input name="sex" type="radio" id="sex0" value="0"  ${one.sex == '0' ? 'checked' : '' }>
								未知
							</label>
						</div>
						<div class="radio-box">
							<label for="sex1">
								<input name="sex" type="radio" id="sex1" value="1" ${one.sex == '1' ? 'checked' : '' }>
								男
							</label>
						</div>
						<div class="radio-box">
							<label for="sex2">
								<input type="radio" id="sex2" name="sex" value="2" ${one.sex == '2' ? 'checked' : '' }>
								女
							</label>
						</div>
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-3">
						<span class="c-red">*</span>手机：
					</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" class="input-text" value="${one.phone }" placeholder=""
							id="phone" name="phone">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-3">
						<span class="c-red">*</span>状态：</label>
					<div class="formControls col-xs-8 col-sm-9 skin-minimal">
						<div class="radio-box">
							<label for="status0">
								<input name="status" type="radio" id="status0" value="0" ${one.status == '0' ? 'checked' : '' }>
								禁用
							</label>
						</div>
						<div class="radio-box">
							<label for="status1">
								<input name="status" type="radio" id="status1" value="1"  ${one.status == '1' || one.status == null ? 'checked' : '' }>
								启用
							</label>
						</div>
					</div>
				</div>
				<div class="row cl">
					<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
						<input class="btn btn-primary radius" type="submit"
							value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
					</div>
				</div>
			</form>
		</article>
		<%@ include file="/common/include/footer_back.jsp" %>
        <script type="text/javascript">
            $(function(){
                $('.skin-minimal input').iCheck({
                    checkboxClass: 'icheckbox-blue',
                    radioClass: 'iradio-blue',
                    increaseArea: '20%'
                });
                
                //表单验证
                $("#formSubmit").validate({
                    rules:{
                        name:{
                            required:true,
                        },
                        capital:{
                            required:true,
                        },
                        stYear:{
                            required:true,
                            isDigits:true,
                        },
                        edYear:{
                            required:true,
                            isDigits:true,
                        }
                    },
                    onkeyup:false,
                    focusCleanup:true,
                    success:"valid",
                    submitHandler:function(form){
                        $(form).ajaxSubmit({
                            type: 'post',
                            success: function(data){
                                /* 弹出框 */
                                layer.msg(data.info,{icon:1,time:3000},function()
                                {
                                    if(data.code == '0')
                                    {
                                        //parent.$('.btn-refresh').click();
                                        /* 刷新父窗口 */
                                        window.parent.location.reload();
                                        var index = parent.layer.getFrameIndex(window.name);
                                        parent.layer.close(index);
                                    }
                                });
                            },
                            dataType:"json"
                        });
                    }
                });
                /* 初始化百度编辑器 */
                var ue = UE.getEditor('editor');
            });
        </script>
	</body>
</html>